package Ite;

import Fac.Television;

public class SkyworthTelevision implements Television {
    private Object[] obj = {"CCTV-1","CCYV-2","CCTV-3"};
    public TVIterator creatIterator()
    {
        return new SkyworthIterator();
    }

    private class SkyworthIterator implements TVIterator
    {
        private int currentIndex = 0;

        public void next()
        {
            if(currentIndex<obj.length)
            {
                currentIndex++;
            }
        }

        public void previous()
        {
            if(currentIndex>0)
            {
                currentIndex--;
            }
        }

        public void setChannel(int i)
        {
            currentIndex = i;
        }

        public Object currentChannel()
        {
            return obj[currentIndex];
        }

        public boolean isFirst()
        {
            return currentIndex==0;
        }
    }
}
